#!/usr/bin/env bash

set -eux
__CURRENT__=`pwd`
__DIR__=$(cd "$(dirname "$0")";pwd)
cd ${__DIR__}
mkdir -p php-fpm-conf
cd ${__DIR__}/php-fpm-conf/

# 更多配置参考
# https://github.com/php/php-src/blob/master/sapi/fpm/www.conf.in
# https://github.com/php/php-src/blob/master/sapi/fpm/php-fpm.conf.in
# https://github.com/docker-library/php/
# https://github.com/docker-library/php/blob/master/8.3/alpine3.20/fpm/Dockerfile

# php:fpm-alpine3.20  是镜像名称
# https://hub.docker.com/_/php/tags?page=&page_size=&ordering=&name=fpm

container_id=$(docker create php:fpm-alpine3.20)  # returns container ID
docker cp $container_id:/usr/local/etc/php-fpm.conf php-fpm.conf
docker cp $container_id:/usr/local/etc/php-fpm.d/www.conf www.conf


docker rm $container_id